-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(CLI): improved nested stack diff #29172
Conversation
… case this other idea doesn't work
… just in case this other idea doesn't work" This reverts commit 10c86cc.
… save it just in case this other idea doesn't work"" This reverts commit e1e4d34.
…far, but save it just in case this other idea doesn't work""" This reverts commit f793503.
…oach so far, but save it just in case this other idea doesn't work"""" This reverts commit 26eeb68.
…ong approach so far, but save it just in case this other idea doesn't work""""" This reverts commit 7725f60.
…y the wrong approach so far, but save it just in case this other idea doesn't work"""""" This reverts commit aa3e4c7.
… probably the wrong approach so far, but save it just in case this other idea doesn't work""""""" This reverts commit 61ff29f.
…o delete the NestedTemplate thing and store the nested templates some other way
This reverts commit 441993e.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- nice job!
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
export interface TemplateWithNestedStackCount { | ||
readonly deployedTemplate: Template; | ||
readonly nestedStackCount: number; | ||
export interface RootTemplateWithNestedStacks { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can RootTemplateWithNestedStacks
and NestedStackTemplates
not be the same structure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided not to because the functions that use this interface as a return type only get the generated templates of nested stacks, not the top level root stack. The functions that take these objects as input have a different way of getting the top-level generated template (namely, they take a StackArtifact
that contains it). They need something special that the StackArtifact
provides, so I decided to keep the generated template out of this data structure, but only for the top-level artifacts.
We could mark generatedTemplate
as optional, but that's less clear than using the separate type.
5e00582
to
2c9dd9e
Compare
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
reverts #29394, which prevented changeset creation during `cdk diff` if a stack did not exist. The lookup of the stack to check its existence is failing for customers that have CI/CD that won't assume the deploy role when running CDK diff. Long-term fix: delete the stack if it didn't exist before we created the changeset, but wait for its state to reach `DELETE_COMPLETE` to avoid problems with subsequent commands. Preserves changes from #29172 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
### Issue # (if applicable) ### Reason for this change The existing nested stack diff places a fake property, `NestedTemplate`, in the templates to be diffed. This prevents displaying resource replacement information in the diff, like we do for top level stacks. This PR does *not* add changeset replacement information from changesets, but it does add replacement information from the spec. ### Description of changes Reworked nested stack diff to treat nested stacks as top level stacks. This improves the visual UX and sets us up for using changesets with nested stacks. #### Before <img width="957" alt="Screenshot 2024-02-19 at 1 47 59 PM" src="https://github.com/aws/aws-cdk/assets/66279577/a94275c4-e7c3-4d2c-a924-ee61c36bea4d"> #### After <img width="957" alt="Screenshot 2024-02-19 at 1 48 48 PM" src="https://github.com/aws/aws-cdk/assets/66279577/5263aaf9-ef2f-4228-b413-81e780c4b8f8"> ### Description of how you validated changes Unit tests + manual tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Issue # 27238
Reason for this change
The existing nested stack diff places a fake property,
NestedTemplate
, in the templates to be diffed. This prevents displaying resource replacement information in the diff, like we do for top level stacks. This PR does not add changeset replacement information from changesets, but it does add replacement information from the spec.Description of changes
Reworked nested stack diff to treat nested stacks as top level stacks. This improves the visual UX and sets us up for using changesets with nested stacks.
Before
After
Description of how you validated changes
Unit tests + manual tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license